package kr.hkit.powerjava.chapter09;

//203페이지 예제3

class Point {
	private int x;
	private int y;

	public Point(int x, int y) {
		this.x = x;
		this.y = y;

	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	@Override
	public String toString() {
		return "Point [x=" + x + ", y=" + y + "]";
	}

}

class CircleTest {
	private int radius = 0;
	private Point center;

	/*
	 * public Circle(Point p, int r) { center = p; radius = r; }
	 */

	void CircleTest(int radius, Point center) {
		this.radius = radius;
		this.center = center;
	}

	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}

	public Point getCenter() {
		return center;
	}

	public void setCenter(Point center) {
		this.center = center;
	}

	@Override
	public String toString() {
		return "Circle [radius=" + radius + ", center=" + center + "]";
	}
}

public class CircleTest {
	public static void main(String[] args) {

		Point p = new Point(25, 78);
		CircleTest c = new CircleTest(10, p);
		System.out.println(c);

		// 방법1
		/*
		 * p.setX(50); p.setY(100); c.setRadius(15); System.out.println(c);
		 */

		// 방법2
		Point p1 = c.getCenter();
		p1.setX(100);
		p1.setY(200);
		c.setRadius(15);
		System.out.println(c);
		
		Math.

	}
}
